<template>
    <dx-treelist
        :codeType="codeType"
        :showCheckbox="true"
        :default-checked-keys="defaultCheckedKeys"
        @check="check"
        :condition="condition"
        :maxHeight="200"
    ></dx-treelist>
</template>

<script>
import DxTreelist from './dx-treelist'
import Toolkit from '../../../assets/js/toolkit.js'
export default {
    name: "dx-multitreeselect",
    components :{
        DxTreelist
    },
    props : {
        value : Array,
        codeType : String,
        condition : {type:Object ,default : ()=>{}}
    },
    computed : {
        defaultCheckedKeys(){
            this.mValue = this.value;
            return this.value;
        }
    },
    data(){
        return {
            treeData: [],
            mValue : this.value,
        }
    },
    methods : {
        check(node ,checks){
            this.mValue = checks.checkedKeys.concat(checks.halfCheckedKeys);
            this.$emit('input' ,this.mValue);
        }
    },
    created(){

    },
    mixins : [Toolkit]
}
</script>
<style scoped>

</style>
